package com.competitions.easydubbing.controller;

import com.competitions.easydubbing.entity.Result;
import com.competitions.easydubbing.service.VideoProcessService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;

/**
 * @author Mapler
 */
@RestController
@RequestMapping(value = "/process")
public class VideoProcessController {
    private final VideoProcessService videoProcessService;

    @Autowired
    public VideoProcessController(VideoProcessService videoProcessService) {
        this.videoProcessService = videoProcessService;
    }

    @RequestMapping(value = "/videoProcess",method = RequestMethod.POST)
    public ResponseEntity<Result> videoProcess(@RequestParam int uid, @RequestBody MultipartFile video){
        return videoProcessService.processVideo(video,uid);
    }
}
